/*
 *  Licensed to the Apache Software Foundation (ASF) under one or more
 *  contributor license agreements.  See the NOTICE file distributed with
 *  this work for additional information regarding copyright ownership.
 *  The ASF licenses this file to You under the Apache License, Version 2.0
 *  (the "License"); you may not use this file except in compliance with
 *  the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
/**
 * @author Pavel Dolgov
 */


/* DO NOT EDIT THIS FILE - it is based on X11 headers and was autogenerated by nativebridge tool */

#include "org_apache_harmony_awt_nativebridge_linux_Xft.h"
#include "org_apache_harmony_awt_nativebridge_linux_ErrorHandler.h"

static libHandler libXft;
JNIEXPORT void JNICALL Java_org_apache_harmony_awt_nativebridge_linux_Xft_init (JNIEnv * env, jclass cls) {
    LOAD_LIB(libXft, Xft);
    XInitThreads();
    XSetErrorHandler(errorHandler);
}


void (* pXftDrawDestroy) (void *) = NULL;

JNIEXPORT void  JNICALL Java_org_apache_harmony_awt_nativebridge_linux_Xft_XftDrawDestroy( JNIEnv *env, jobject self, jlong draw) {
    if (pXftDrawDestroy == NULL) {
        pXftDrawDestroy = (void (*) (void *)) FindFunction(libXft, "XftDrawDestroy");
    }
    (* pXftDrawDestroy)((void *)(size_t) draw);
}

int (* pXftDrawSetClip) (void *, void *) = NULL;

JNIEXPORT jint  JNICALL Java_org_apache_harmony_awt_nativebridge_linux_Xft_XftDrawSetClip( JNIEnv *env, jobject self, jlong draw, jlong r) {
    if (pXftDrawSetClip == NULL) {
        pXftDrawSetClip = (int (*) (void *, void *)) FindFunction(libXft, "XftDrawSetClip");
    }
    return (jint) (* pXftDrawSetClip)((void *)(size_t) draw, (void *)(size_t) r);
}

int (* pXftDrawSetClipRectangles) (void *, int, int, void *, int) = NULL;

JNIEXPORT jint  JNICALL Java_org_apache_harmony_awt_nativebridge_linux_Xft_XftDrawSetClipRectangles( JNIEnv *env, jobject self, jlong draw, jint xOrigin, jint yOrigin, jlong rects, jint n) {
    if (pXftDrawSetClipRectangles == NULL) {
        pXftDrawSetClipRectangles = (int (*) (void *, int, int, void *, int)) FindFunction(libXft, "XftDrawSetClipRectangles");
    }
    return (jint) (* pXftDrawSetClipRectangles)((void *)(size_t) draw, (int) xOrigin, (int) yOrigin, (void *)(size_t) rects, (int) n);
}

